Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding a devcontainer #73

Merged
merged 8 commits into from
Apr 24, 2022
Merged

Adding a devcontainer #73

merged 8 commits into from
Apr 24, 2022

Conversation

koudaiii
Copy link
Member

@koudaiii koudaiii commented Apr 23, 2022

Why

ref https://microsoft.github.io/code-with-engineering-playbook/developer-experience/devcontainers/

I would like to make more people can contribute to Azure Terrafy.

  1. When someone develops Azure Terrafy, someone needs to set up a few things ready for the development environment. (e.g. GoLang / Azure CLI / terraform)
  2. I want to enable e2e testing by switching to another environment without affecting my existing environment (Azure AD tenant, az config, terraform config, Go version, env, etc.).

I want to use a devcontainer to improve two things. ref https://docs.github.com/en/codespaces/setting-up-your-project-for-codespaces/introduction-to-dev-containers

About dev containers

Development containers, or dev containers, are Docker containers that are specifically configured to provide a full-featured development environment. Whenever you work in a codespace, you are using a dev container on a virtual machine.

What

Set up devcontainer

  • Set up Go
  • Installing Azure cli
  • Installing terraform cli

CONTRIBUTING.md is not in this repository right now, but I would like to describe how to contribute as follows.

How to make the development environment using devcontainer

Using Visual Studio Code with Remote - Containers extension installed, you quickly have your environment set up and ready to go with everything you need to get started.

  1. Open this project in VS Code.

  2. If Docker isn't already running, make sure it is now.

  3. Open the Command Pallet (Command+Shift+P on MacOS or CTRL+Shift+P on Windows). Type Remote-Containers: Open Folder in Container... and hit enter. Or click on the remote container icon in the lower-left corner.

  4. VS Code will relaunch and begin building your development container. VS Code will install all the necessary dependencies required for you to begin developing.

  5. The container has finished building, open a new terminal in VS Code (Control+Shift+` ) and type:

    vscode ➜ /workspaces/aztfy (koudaiii/devcontainer ✗) $ az version
    {
      "azure-cli": "2.35.0",
      "azure-cli-core": "2.35.0",
      "azure-cli-telemetry": "1.0.6",
      "extensions": {}
    }
    
    vscode ➜ /workspaces/aztfy (koudaiii/devcontainer ✗) $ terraform version
    Terraform v0.15.5
    on linux_amd64
    
    Your version of Terraform is out of date! The latest version
    is 1.1.9. You can update by downloading from https://www.terraform.io/downloads.html
    
    vscode ➜ /workspaces/aztfy (koudaiii/devcontainer ✗) $ az login
    
    ・・・・
    
    vscode ➜ /workspaces/aztfy (koudaiii/devcontainer ✗) $ go build -o bin/aztfy
    vscode ➜ /workspaces/aztfy (koudaiii/devcontainer ✗) $ bin/aztfy <resource group>
    
    ・・・・
  6. you can now start developing within the Remote Container environment!

Copy link
Collaborator

@magodo magodo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this PR!
I have left some additional mostly minor comments that once addressed this should be good to merge 👍

.devcontainer/devcontainer.json Outdated Show resolved Hide resolved
.devcontainer/devcontainer.json Outdated Show resolved Hide resolved
.devcontainer/Dockerfile Outdated Show resolved Hide resolved
@koudaiii koudaiii requested a review from magodo April 24, 2022 08:42
@koudaiii
Copy link
Member Author

@magodo Thank you for your review. I commented and pushed some commits. 😄

@koudaiii koudaiii requested a review from magodo April 24, 2022 10:17
Copy link
Collaborator

@magodo magodo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@magodo magodo merged commit a169a9c into Azure:main Apr 24, 2022
@koudaiii
Copy link
Member Author

Thank you for your review and your time 😄

@koudaiii koudaiii deleted the koudaiii/devcontainer branch April 24, 2022 11:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants